// remarkMember.js
var app = getApp(); 
Page({

  /**
   * 页面的初始数据
   */
  data: {
    memberList: [],
    teamId :0
  },
 toNext:function(e){
    var that = this;
    console.log("班级学员跳转===",e);
    var studentId  = e.currentTarget.dataset.id;
    var index = e.currentTarget.dataset.index;
    var data = that.data.memberList[index];
    var studentNo = data.studentNo;
    var studentName = data.studentName;
    var teamId = that.data.teamId;
    console.log("teamId===",teamId);
    wx.reLaunch({
      url: "/pages/remarkWrite/remarkWrite?studentId="+studentId + "&teamId=" + teamId+"&studentNo="+studentNo+"&studentName="+studentName
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    console.log("班级学员加载options数据---",options);
    wx.request({
      url: app.globalData.http + "selectStudentByTeamId.do",
      header: {
        'content-type': 'application/json'
      },
      data:{
        teamId : parseInt(options.id),
        busId: parseInt(wx.getStorageSync("busId")),
        employeesId: parseInt(wx.getStorageSync("employeesId")),
        schoolId: parseInt(wx.getStorageSync("schoolId"))
      },
      success: function(res){
        console.log("我的班级-班级学员请求成功的数据---",res.data);
          var code = res.data.code;
          if(code == 100){
            that.setData({
              memberList: res.data.data.subList,
              pageCount: res.data.data.pageCount,
              pageSize: res.data.data.pageSize,
              teamId: options.id
            })
          }
          if(code == 200){
            that.setData({
              codeTxt: "数据为空"
            })
          }
          if(code == 300){
            codeTxt: "哇哦~数据异常"
          }
      }
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  }
})